﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __E4CE045A_445B_4CAD_AB56_FC91C9E99CE2__
#define __E4CE045A_445B_4CAD_AB56_FC91C9E99CE2__

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace xos_common
{

	///////////////////////////////////////////////////////////////////////////////////////////////////////
	// 
	// id生成器，考虑已有id,生成顺序的不重复id.可以在四字节数值中轮转(去除了-1, 0, 1三个值)
	// 
	class i_id_generator : public xos::i_release
	{
	public:
		virtual ~i_id_generator(){}

	public:
		virtual int remove( int id ) = 0;
		virtual int add( int id ) = 0;
		virtual int gen( int * lpnId ) = 0;
	};

} // xos_common

#endif // __E4CE045A_445B_4CAD_AB56_FC91C9E99CE2__
